package com.chapter12.five_exception;

public class arrayoutofboundexception_ {
    public static void main(String[] args) {
        int[] a  = {1,2,3,4,5};

        for (int i : a ) {
            System.out.println(a[i]);
        }

        for (int j = 0 ; j <= a.length ; j++) {
            System.out.println(a[j]);
        } //这里报错，数组越界

    }
}
